<?php
/**
 * Provide a interface to the Smarty template parsing engine.
 * Includes some methods to asign values from rail_object directly to Smarty parser. The goal is to get an easy integration
 * into rail and so speadup the development of web aplications.
 *
 * PHP versions 5
 *
 * Copyright (C)
 * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
 * of ERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software
 * Fundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
 *
 * @author Bastian Schröder <bs@chemanet.de>
 * @version 2007-12-14
 * @package rail
 */

// define some constants
define( 'PHPrail_SMARTY_VERSION', '2.6.18' );
define( 'PHPrail_SMARTY_LEFTDELIMITER', '<!--{' );
define( 'PHPrail_SMARTY_RIGHTDELIMITER', '}-->' );

// include Smarty libary
require( PHPrail_BASEDIR . 'smarty-' . PHPrail_SMARTY_VERSION . '/Smarty.class.php' );

class rail_smarty extends Smarty {

	/**
	 * Constructor
	 * Set some default Smarty class values.
	 *
	 * @param string $pSmartyDir
	 * @param bool $pSmartyCache enable Smarty caching.
	 */
	public function __construct ( $pSmartyDir = './', $pSmartyCache = false  ) {
		// construct Smarty
		$this->Smarty();
		$this->caching = $pSmartyCache;
		$this->left_delimiter = PHPrail_SMARTY_LEFTDELIMITER;
		$this->right_delimiter = PHPrail_SMARTY_RIGHTDELIMITER;
		$this->template_dir = $pSmartyDir . 'templates/';
		$this->compile_dir = $pSmartyDir . 'cache/';
		$this->config_dir = $pSmartyDir . 'cache/';
		$this->cache_dir = $pSmartyDir . 'cache/';
	}

} // End of rail_smarty
?>